const code_data = 1
const code_mark = 2

chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
  console.log("收到消息...")
  if(message.code === code_data) {

  } else if(message.code === code_mark) {

  } else {
    console.log("不支持的code")
  }
})

function getRoomProfile(name, callback) {



}

function xhr(url, callback) {
  const xhr = new XMLHttpRequest()
  xhr.open("GET", url)
  xhr.responseType = "json"
  xhr.onreadystatechange = function () {
    if (xhr.readyState === 4 && xhr.status === 200) {
      // 处理响应正文responseText
      callback(xhr.response)
    }
  }
  xhr.send()
}